home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / Sample Code / Sample Editors⁄Viewers / Panel Editor / Source / FrameInfo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-08  |  4.3 KB  |  203 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        FrameInfo.h
  3.  
  4.     Contains:    FrameInfo utility class
  5.  
  6.     Written by:    Steve Smith
  7.  
  8.     Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  9. */
  10.  
  11.  
  12. #ifndef _FRAMEINFO_
  13. #define _FRAMEINFO_
  14.  
  15. // --- PanelEditor Includes ---
  16.  
  17. #ifndef _PANELEDITORUTILS_
  18. #include "PanelEditorUtils.h"
  19. #endif
  20.  
  21. #ifndef _SAMPLECOLLECTIONS_
  22. #include "SampleCollections.h"
  23. #endif
  24.  
  25. // --- OpenDoc Includes ---
  26.  
  27. #ifndef _ODTYPES_
  28. #include <ODTypes.h>
  29. #endif
  30.  
  31. #ifndef SOM_ODShape_xh
  32. #include <Shape.xh>
  33. #endif
  34.  
  35. // --- OpenDoc Utilities ---
  36.  
  37. #ifndef _ITEXT_
  38. #include <IText.h>
  39. #endif
  40.  
  41. #ifndef _ODUTILS_
  42. #include <ODUtils.h>
  43. #endif
  44.  
  45. // --- Macintosh Includes ---
  46.  
  47. #ifndef __TYPES__
  48. #include <Types.h>
  49. #endif
  50.  
  51. // --- Forward Declarations ---
  52. class ODDraft;
  53. class ODFacet;
  54. class ODWindow;
  55. class ODStorageUnitView;
  56. class ODSession;
  57. class CScrollbar;
  58.  
  59. //------------------------------------------------------------------------------
  60.  
  61. class CFrameInfo
  62. {
  63.     public:
  64.             CFrameInfo(ODSession* session);
  65.             ~CFrameInfo();
  66.     
  67.     void    Externalize(Environment* ev, ODStorageUnitView* storageUnitView);
  68.     void    CleanseFrameInfoProperty(Environment* ev, ODStorageUnit* storageUnit);
  69.     void    ExternalizeFrameInfo(Environment* ev, ODStorageUnit* storageUnit,
  70.                                     ODDraftKey key, ODFrame* scopeFrame);
  71.     void    CloneInto(Environment *ev, ODDraftKey key,
  72.                                     ODStorageUnitView* storageUnitView,
  73.                                     ODFrame* scopeFrame);
  74.     void    InitFromStorage(Environment* ev, ODStorageUnitView* storageUnitView);
  75.                 
  76.     ODBoolean        IsFrameActive();
  77.     void            SetFrameActive(ODBoolean active);
  78.     ODBoolean        FrameNeedsReactivating();
  79.     void            SetFrameReactivate(ODBoolean reactivate);
  80.     ODFacet*        GetActiveFacet();
  81.     void            SetActiveFacet(ODFacet* facet);
  82.     void            SetSourceFrame(Environment* ev, ODFrame* frame);
  83.     ODFrame*        GetSourceFrame(Environment* ev);
  84.     void            ReleaseSourceFrame(Environment* ev);
  85.     ODBoolean        HasSourceFrame();
  86.     ODWindow*        AcquirePartWindow(Environment* ev);
  87.     void            SetPartWindow(Environment* ev, ODWindow* window);
  88.     void            SetDependentFrame(Environment* ev, ODFrame* frame);
  89.     ODFrame*        GetDependentFrame(Environment* ev);
  90.     ODBoolean        HasDependentFrame();
  91.     void            ReleaseDependentFrame(Environment* ev);
  92.     void            SetShouldDisposeWindow(ODBoolean should);
  93.     ODBoolean        ShouldDisposeWindow();
  94.     ODTypeToken        GetPreviousViewType();
  95.     void            SetPreviousViewType(ODTypeToken viewType);
  96.     ODBoolean        ShouldNegotiate();
  97.     void            SetShouldNegotiate(ODBoolean should);
  98.     
  99.     private:
  100.     CFrameInfo() {} /* don't want parts to call */
  101.     
  102.     ODSession*        fSession;
  103.     ODBoolean        fFrameActive;
  104.     ODBoolean        fFrameReactivate;
  105.     ODBoolean        fShouldDisposeWindow;
  106.     ODFacet*        fActiveFacet;
  107.     CFrameProxy*    fSourceFrame;
  108.     CFrameProxy*    fDependentFrame;
  109.     ODID            fPartWindowID;
  110.     ODTypeToken        fPreviousViewType;
  111.     ODBoolean        fShouldNegotiate;
  112. };
  113.  
  114.  
  115.  
  116.  
  117. //-------------------------------------------------------------------------
  118. // Inline methods
  119. //-------------------------------------------------------------------------
  120.  
  121. inline ODBoolean CFrameInfo::IsFrameActive()
  122. {
  123.     return fFrameActive;
  124. }
  125.  
  126. inline void CFrameInfo::SetFrameActive(ODBoolean active)
  127. {
  128.     fFrameActive = active;
  129. }
  130.  
  131. inline ODBoolean CFrameInfo::FrameNeedsReactivating()
  132. {
  133.     return fFrameReactivate;
  134. }
  135.  
  136. inline void CFrameInfo::SetFrameReactivate(ODBoolean reactivate)
  137. {
  138.     fFrameReactivate = reactivate;
  139. }
  140.  
  141. inline ODFacet* CFrameInfo::GetActiveFacet()
  142. {
  143.     return fActiveFacet;
  144. }
  145.  
  146. inline void CFrameInfo::SetActiveFacet(ODFacet* facet)
  147. {
  148.     fActiveFacet = facet;
  149. }
  150.  
  151. inline ODFrame* CFrameInfo::GetSourceFrame(Environment* ev)
  152. {
  153.     return (fSourceFrame->GetFrame(ev));
  154. }
  155.  
  156. inline ODBoolean CFrameInfo::HasSourceFrame()
  157. {
  158.     return (fSourceFrame != kODNULL);
  159. }
  160.  
  161. inline ODFrame* CFrameInfo::GetDependentFrame(Environment* ev)
  162. {
  163.     return (fDependentFrame->GetFrame(ev));
  164. }
  165.  
  166. inline ODBoolean CFrameInfo::HasDependentFrame()
  167. {
  168.     return (fDependentFrame != kODNULL);
  169. }
  170.  
  171. inline void CFrameInfo::SetShouldDisposeWindow(ODBoolean should)
  172. {
  173.     fShouldDisposeWindow = should;
  174. }
  175.  
  176. inline ODBoolean CFrameInfo::ShouldDisposeWindow()
  177. {
  178.     return fShouldDisposeWindow;
  179. }
  180.  
  181. inline ODTypeToken CFrameInfo::GetPreviousViewType()
  182. {
  183.     return fPreviousViewType;
  184. }
  185.  
  186. inline void CFrameInfo::SetPreviousViewType(ODTypeToken viewType)
  187. {
  188.     fPreviousViewType = viewType;
  189. }
  190.  
  191. inline ODBoolean CFrameInfo::ShouldNegotiate()
  192. {
  193.     return fShouldNegotiate;
  194. }
  195.  
  196. inline void CFrameInfo::SetShouldNegotiate(ODBoolean should)
  197. {
  198.     fShouldNegotiate = should;
  199. }
  200.  
  201. #endif
  202.  
  203.